package com.changcheng.project.yuminsi.controller;


import com.changcheng.framework.aspectj.LogPointcut;
import com.changcheng.project.yuminsi.service.AfterSaleService;
import com.changcheng.project.yuminsi.vo.ActivateResultRequest;
import com.changcheng.project.yuminsi.vo.BaseOutput;
import com.changcheng.project.yuminsi.vo.EtcLogOffRequest;
import com.changcheng.project.yuminsi.vo.UniversalResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @author yuminsi
 * @description
 * @date 2020/8/18 15:31
 * @since
 */
@Api(description = "ETC售后接口")
@RestController
@RequestMapping("/v1.0/etc")
public class AfterSaleController {

    @Autowired
    private AfterSaleService afterSaleService;

    @ApiOperation(value = "查询注销业务状态", notes = "查询注销业务状态")
    @LogPointcut(description = "查询注销业务状态")
    @PostMapping("/etcAfterSale/etcLogOff")
    public BaseOutput etcLogOff(@RequestBody EtcLogOffRequest etcLogOffRequest) throws Exception {
        return afterSaleService.etcLogOff(etcLogOffRequest);
    }



    @ApiOperation(value = "获取二次激活指令接口", notes = "获取二次激活指令接口")
    @LogPointcut(description = "获取二次激活指令接口")
    @GetMapping("/etcAfterSale/getActivInstruct")
    public BaseOutput getActivInstruct(@RequestParam("obuId") String obuId,
                                       @RequestParam("random") String random,
                                       @RequestParam("acctId") String acctId) throws Exception {
        return afterSaleService.getActivInstruct(obuId, random, acctId);
    }

    @ApiOperation(value = "激活结果同步", notes = "激活结果同步")
    @PostMapping("/etcAfterSale/updateActiveStatus")
    public BaseOutput updateActiveStatus(@RequestBody ActivateResultRequest activateResultRequest) throws Exception {
        return afterSaleService.updateActiveStatus(activateResultRequest);
    }

    @ApiOperation(value = "获取车型编码/cc码", notes = "获取车型编码/cc码")
    @LogPointcut(description = "获取车型编码/cc码")
    @GetMapping("/vehicle-master/vehicle/getVehicle/{vin}")
    public BaseOutput getVehiCcCode(@PathVariable("vin") String vin) throws Exception {
        return afterSaleService.getVehiCcCode(vin);
    }

}
